/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_editar_foto.java
 *
 * Created on 26/04/2012, 09:45:11 AM
 */

package sie_invdis;

import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
import java.text.*;
import java.text.ParseException;
import org.jfree.ui.RefineryUtilities;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author Administrador
 */
public class articulos_sie_editar_foto extends javax.swing.JFrame {

    private javax.swing.table.DefaultTableModel jtable_modelo;
DefaultTableCellRenderer alinearCentro, alinearderecha, alinearIzquierda;
    private ResultSet rs = null;
    private bd_conexion x = new bd_conexion();
    private int buscamp=2,controlcomboinsu=0,opbuscamp=2,control_enter=0,yacarguecatdocto=0,indexactual=0,listap=2,opcioncatalogo=3, buscampalma=1,controlcombocambio=0;
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");

    /** Creates new form articulos_sie_editar_foto */
    public articulos_sie_editar_foto() {
        this.iniciar_modelo_de_tabla();
        initComponents();
            


       jtbl_articulosentiendas.getColumnModel().getColumn(0).setPreferredWidth(40);//tienda
       jtbl_articulosentiendas.getColumnModel().getColumn(1).setPreferredWidth(10);//clave
       jtbl_articulosentiendas.getColumnModel().getColumn(2).setPreferredWidth(10);//codigo
       jtbl_articulosentiendas.getColumnModel().getColumn(3).setPreferredWidth(10);//descripcion
       jtbl_articulosentiendas.getColumnModel().getColumn(4).setPreferredWidth(10);//p. rebaja

        //this.carga_datos_monedas();
        this.centrar_datos();
    }
  public articulos_sie_editar_foto(String id,String descripcion,String precio1,String precio2) {
      this.iniciar_modelo_de_tabla();
        initComponents();
       // this.carga_datos_monedas();
        this.centrar_datos();

          jtbl_articulosentiendas.getColumnModel().getColumn(0).setPreferredWidth(40);//tienda
       jtbl_articulosentiendas.getColumnModel().getColumn(1).setPreferredWidth(10);//clave
       jtbl_articulosentiendas.getColumnModel().getColumn(2).setPreferredWidth(10);//codigo
       jtbl_articulosentiendas.getColumnModel().getColumn(3).setPreferredWidth(10);//descripcion
       jtbl_articulosentiendas.getColumnModel().getColumn(4).setPreferredWidth(10);//p. rebaja

        this.setTitle("Articulo:"+id+" "+ descripcion + "  Precio "+precio1+" Mayoreo "+precio2);
        this.jtf_clavearticulo.setText(id);
        this.jtf_descripcion.setText(descripcion);

         this.carga_datos_articulotodaslastiendas(id);
            this.carga_datos_articulotodaslasbodegas(id);
        /*for(int i = 0 ;i < numerofilas; i++)
                        {
                            cambio = Float.valueOf(this.jtbl_preciomonedas.getValueAt(i, 1).toString()).floatValue();
                            jtable_modelo.setValueAt(miformat.format(Float.valueOf(precio1)/cambio),i,2);
                        }
         */
        this.jep_articuloimagen.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/fotoshd/"+id+".JPG\" width=\"680\" height=\"510\" border=\"0\" alt=\"Foto Articulo\"></img>");
    }
public articulos_sie_editar_foto(String id) {
      this.iniciar_modelo_de_tabla();
        initComponents();
        //this.carga_datos_monedas();
        this.centrar_datos();
          jtbl_articulosentiendas.getColumnModel().getColumn(0).setPreferredWidth(40);//tienda
       jtbl_articulosentiendas.getColumnModel().getColumn(1).setPreferredWidth(10);//clave
       jtbl_articulosentiendas.getColumnModel().getColumn(2).setPreferredWidth(10);//codigo
       jtbl_articulosentiendas.getColumnModel().getColumn(3).setPreferredWidth(10);//descripcion
       jtbl_articulosentiendas.getColumnModel().getColumn(4).setPreferredWidth(10);//p. rebaja
        //this.carga_datos_catalogoarticulos_almacen(1,1,id);
        this.carga_datos_articulotodaslastiendas(id);
        this.carga_datos_articulotodaslasbodegas(id);
    }

private void iniciar_modelo_de_tabla()
        {
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><BODY><b>Tienda</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>P.Reb</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>E.Tienda</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>E.Bodega</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>E.Total</b></BODY></html>");

     }


private void carga_datos_articulotodaslastiendas(String tbusca)
        {
            String texto="select * from x1sieuno_articulo_detalle_ventasacumv2(6,0,'','"+tbusca+"','') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text,item text,precioma real,ultimo_costo numeric)";
            System.out.println(texto);
            String despartido[]=null;
            Object[] fnewRow = new Object[5];
            DecimalFormat miformatd = new DecimalFormat("############");

            while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                             despartido=rs.getString("descor").split(":");

                            this.jtf_clavearticulo.setText(rs.getString("clavepro"));
                            this.jtf_descripcion.setText(despartido[1]);
                            this.jtf_clavearticulo1.setText(rs.getString("cod"));
                            this.setTitle("Articulo:"+rs.getString("clavepro")+" "+ despartido[1]+ "  Precio "+rs.getString("preve"));
                           
                            fnewRow[0]=despartido[0]+":"+despartido[2];
                            if(rs.getString("pre_re")!=null)
                                {
                                    fnewRow[1]=miformatd.format(rs.getFloat("pre_re"));
                                }
                            else
                                {
                                    fnewRow[1]="";
                                }
                            fnewRow[2]=rs.getString("exi");
                            fnewRow[3]="0";
                            fnewRow[4]="0";
                            jtable_modelo.addRow(fnewRow);
                            this.jep_articuloimagen.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/fotoshd/"+rs.getString("clavepro")+".JPG\" width=\"680\" height=\"510\" border=\"0\" alt=\"Foto Articulo\"></img>");

                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }

        }

private void carga_datos_articulotodaslasbodegas(String busque)
        {
            String texto="select * from x1sieuno_articulo_detalle_ventasacumv2(8,0,'','"+busque+"','') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text,item text,precioma real,ultimo_costo numeric)";
            System.out.println("voy a bodega"+texto);
            String despartido[]=null,mesactual[]=null;
            int ii=0;
            DecimalFormat miformatd = new DecimalFormat("############");
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");
                           for( ii=0;ii<this.jtable_modelo.getRowCount();ii++)
                                {
                                    mesactual=jtable_modelo.getValueAt(ii, 0).toString().split(":");
                                    // System.out.println("Agregando:"+mesactual+" "+mes);
                                    if (mesactual[0].equals(despartido[0]))
                                        {
                                            System.out.println("Tienda "+mesactual[0]+"Existencia="+rs.getString("exi"));
                                            jtable_modelo.setValueAt(rs.getString("exi"),ii ,3);
                                        }
                                }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }

                for( ii=0;ii<this.jtable_modelo.getRowCount();ii++)
                                {
                                    jtable_modelo.setValueAt(miformatd.format(Float.valueOf(jtable_modelo.getValueAt(ii, 2).toString())+Float.valueOf(jtable_modelo.getValueAt(ii, 3).toString())),ii ,4);
                                }

        }

  /*private void carga_datos_monedas()
    {
    DecimalFormat miformat = new DecimalFormat("############.##");
          Object[] fnewRowe = new Object[3];
        try
            {
                rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_ventas_monedas(0,0,'','') as (id smallint,descrip character varying(30),cambioactu numeric,fechaactua date);",variables_global.getconexiongral());
               while (rs.next())
                    {
                        fnewRowe[0]="<html>"+rs.getString("id")+":"+rs.getString ("descrip")+"<br>"+this.fechaeuropea(rs.getString("fechaactua"))+"</html>";
                        fnewRowe[1]=miformat.format( rs.getFloat("cambioactu"));
                        fnewRowe[2]="0";
                        jtable_modelo.addRow(fnewRowe);
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }*/
/*private void iniciar_modelo_de_tabla()
        {
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><BODY><b>Moneda</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>T.Cambio</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Precio</b></BODY></html>");
     }
*/
private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }

public void centrar_datos()
    {
        alinearderecha = new DefaultTableCellRenderer();
        alinearderecha.setHorizontalAlignment(SwingConstants.RIGHT);

       //jtbl_preciomonedas.getColumnModel().getColumn(1).setCellRenderer(alinearderecha);
       // jtbl_preciomonedas.getColumnModel().getColumn(2).setCellRenderer(alinearderecha);


    }



    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jep_articuloimagen = new javax.swing.JEditorPane();
        jPanel2 = new javax.swing.JPanel();
        jtf_descripcion = new javax.swing.JTextField();
        jbtn_buscar = new javax.swing.JButton();
        jtf_busqueda = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jtf_clavearticulo = new javax.swing.JTextField();
        jtf_clavearticulo1 = new javax.swing.JTextField();
        jScrollPane12 = new javax.swing.JScrollPane();
        jtbl_articulosentiendas = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jMenuBar1 = new javax.swing.JMenuBar();
            jMenu1 = new javax.swing.JMenu();
            jmni_salir = new javax.swing.JMenuItem();
            jMenu2 = new javax.swing.JMenu();
            jMenuItem1 = new javax.swing.JMenuItem();
            jmni_buscar = new javax.swing.JMenuItem();

            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setName("Form"); // NOI18N

            jPanel1.setName("jPanel1"); // NOI18N

            jScrollPane1.setName("jScrollPane1"); // NOI18N

            org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_editar_foto.class);
            jep_articuloimagen.setContentType(resourceMap.getString("jep_articuloimagen.contentType")); // NOI18N
            jep_articuloimagen.setName("jep_articuloimagen"); // NOI18N
            jScrollPane1.setViewportView(jep_articuloimagen);

            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 689, Short.MAX_VALUE)
            );
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE)
            );

            jPanel2.setName("jPanel2"); // NOI18N

            jtf_descripcion.setEditable(false);
            jtf_descripcion.setFont(resourceMap.getFont("jtf_descripcion.font")); // NOI18N
            jtf_descripcion.setName("jtf_descripcion"); // NOI18N

            jbtn_buscar.setIcon(resourceMap.getIcon("jbtn_buscar.icon")); // NOI18N
            jbtn_buscar.setText(resourceMap.getString("jbtn_buscar.text")); // NOI18N
            jbtn_buscar.setName("jbtn_buscar"); // NOI18N
            jbtn_buscar.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jbtn_buscarActionPerformed(evt);
                }
            });

            jtf_busqueda.setFont(resourceMap.getFont("jtf_busqueda.font")); // NOI18N
            jtf_busqueda.setToolTipText(resourceMap.getString("jtf_busqueda.toolTipText")); // NOI18N
            jtf_busqueda.setName("jtf_busqueda"); // NOI18N
            jtf_busqueda.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jtf_busquedaActionPerformed(evt);
                }
            });

            javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
            jPanel2.setLayout(jPanel2Layout);
            jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jtf_busqueda, javax.swing.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jbtn_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jtf_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 578, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
            );
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jtf_descripcion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jbtn_buscar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jtf_busqueda, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE))
                            .addContainerGap())))
            );

            jPanel3.setName("jPanel3"); // NOI18N

            jtf_clavearticulo.setEditable(false);
            jtf_clavearticulo.setFont(resourceMap.getFont("jtf_clavearticulo.font")); // NOI18N
            jtf_clavearticulo.setName("jtf_clavearticulo"); // NOI18N

            jtf_clavearticulo1.setEditable(false);
            jtf_clavearticulo1.setFont(resourceMap.getFont("jtf_clavearticulo1.font")); // NOI18N
            jtf_clavearticulo1.setName("jtf_clavearticulo1"); // NOI18N

            jScrollPane12.setName("jScrollPane12"); // NOI18N

            jtbl_articulosentiendas.setModel(this.jtable_modelo);
            jtbl_articulosentiendas.setName("jtbl_articulosentiendas"); // NOI18N
            jtbl_articulosentiendas.setRowHeight(22);
            jScrollPane12.setViewportView(jtbl_articulosentiendas);

            javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
            jPanel3.setLayout(jPanel3Layout);
            jPanel3Layout.setHorizontalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jtf_clavearticulo, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)
                .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)
                .addComponent(jtf_clavearticulo1, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)
            );
            jPanel3Layout.setVerticalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jtf_clavearticulo, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jtf_clavearticulo1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(36, 36, 36)
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(193, Short.MAX_VALUE))
            );

            jMenuBar1.setName("jMenuBar1"); // NOI18N

            jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
            jMenu1.setName("jMenu1"); // NOI18N

            jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
            jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
            jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
            jmni_salir.setName("jmni_salir"); // NOI18N
            jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jmni_salirActionPerformed(evt);
                }
            });
            jMenu1.add(jmni_salir);

            jMenuBar1.add(jMenu1);

            jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
            jMenu2.setName("jMenu2"); // NOI18N

            jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
            jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
            jMenuItem1.setName("jMenuItem1"); // NOI18N
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem1ActionPerformed(evt);
                }
            });
            jMenu2.add(jMenuItem1);

            jmni_buscar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK));
            jmni_buscar.setIcon(resourceMap.getIcon("jmni_buscar.icon")); // NOI18N
            jmni_buscar.setText(resourceMap.getString("jmni_buscar.text")); // NOI18N
            jmni_buscar.setName("jmni_buscar"); // NOI18N
            jmni_buscar.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jmni_buscarActionPerformed(evt);
                }
            });
            jMenu2.add(jmni_buscar);

            jMenuBar1.add(jMenu2);

            setJMenuBar(jMenuBar1);

            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap()))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(11, 11, 11))
            );

            pack();
        }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
    if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0)
            {
                 this.dispose();
            }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jtf_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_busquedaActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
}//GEN-LAST:event_jtf_busquedaActionPerformed

    private void jbtn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_buscarActionPerformed
        // TODO add your handling code here:
        // this.jtf_busqueda.getText();
       // if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
            

            this.carga_datos_articulotodaslastiendas(this.jtf_busqueda.getText().toString().toUpperCase().trim());
            this.carga_datos_articulotodaslasbodegas(this.jtf_busqueda.getText().toString().toUpperCase().trim());
            this.jtf_busqueda.setText("");
            this.jtf_busqueda.requestFocus();
        //} else {
        //    this.jtf_busqueda.requestFocus();
       // }


    }//GEN-LAST:event_jbtn_buscarActionPerformed

    private void jmni_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_buscarActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
}//GEN-LAST:event_jmni_buscarActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new articulos_sie_editar_foto().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JButton jbtn_buscar;
    private javax.swing.JEditorPane jep_articuloimagen;
    private javax.swing.JMenuItem jmni_buscar;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JTable jtbl_articulosentiendas;
    private javax.swing.JTextField jtf_busqueda;
    private javax.swing.JTextField jtf_clavearticulo;
    private javax.swing.JTextField jtf_clavearticulo1;
    private javax.swing.JTextField jtf_descripcion;
    // End of variables declaration//GEN-END:variables

}
